/*****************************************************************************

File:   otkCreateIntfDataUtils.java

Date          Build     Author        Version    Comments
27-Dec-12    P-20-20    dshah          $$1        Created
02-Jan-14    P-20-44    rkumbhare      $$2        Updated.

****************************************************************************/

/* 
 
 Utilites for IntfData methods.
  
*/

package com.ptc.otkjavaexamples;

import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcCommand.*;
import com.ptc.pfc.pfcGlobal.*;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcModelItem.*;
import com.ptc.pfc.pfcFeature.*;
import com.ptc.pfc.pfcSolid.*;
import javax.swing.JOptionPane;
import java.io.*;

import com.ptc.cipjava.*;
import com.ptc.pfc.pfcFamily.*;
import com.ptc.pfc.pfcServer.*;
import com.ptc.pfc.pfcWindow.*;
import com.ptc.wfc.wfcSolid.*;
import com.ptc.wfc.wfcCombState.*;
import com.ptc.pfc.pfcBase.*; 
import com.ptc.pfc.pfcGeometry.*;
import com.ptc.wfc.wfcGeometry.*;
import com.ptc.wfc.wfcModel.*; 
import java.lang.String;


class otkCreateIntfDataUtils 
{
    
    
    
    public otkCreateIntfDataUtils()
    {
    }
    
    
public static void CreateIntfDataFile (InterfaceData IntfData, String modelName, String filename, BufferedWriter infoFile)
{
	try
	{
	infoFile.write("package com.ptc.otkjavaexamples;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcGeometry.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.cipjava.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcSession.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcCommand.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcGlobal.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcModel.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcModelItem.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcFeature.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcSolid.*;");
	infoFile.newLine();
	infoFile.write("import java.io.*;");
	infoFile.newLine();
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcFamily.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcServer.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcWindow.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.wfc.wfcSolid.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcBase.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.wfc.wfcModel.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.wfc.wfcGeometry.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.wfc.wfcSolid.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.wfc.wfcPart.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcPart.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcDimension.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcAssembly.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcSelect.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcUnits.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcObject.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcUI.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcRelations.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcDetail.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcDrawing.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcView.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcView2D.*;");
	infoFile.newLine();
	infoFile.write("import com.ptc.pfc.pfcModel2D.*;");
	infoFile.newLine();
	infoFile.newLine();
	infoFile.write("class " + filename);
	infoFile.newLine();
	infoFile.write("{");
	infoFile.newLine();
	infoFile.newLine();
	infoFile.write("\tpublic " + filename + "()");
	infoFile.newLine();
	infoFile.write("\t{");
	infoFile.newLine();
	infoFile.write("\t}");
	infoFile.newLine();
	infoFile.newLine();
	infoFile.write("\tpublic static InterfaceData OtkUtilInterfaceData()");
	infoFile.newLine();
	infoFile.write("\t{");
	infoFile.newLine();
	infoFile.write("\t\ttry");
	infoFile.newLine();
	infoFile.write("\t\t{");
	infoFile.newLine();

	// ******************************* SURFACE Data ********************************** /
	WSurfaceDescriptors SurfDescs = IntfData.GetSurfaceData ();	
	infoFile.write("\t\tWSurfaceDescriptors wSurfDescs = WSurfaceDescriptors.create(); " );
	infoFile.newLine();
	
	/* Saving the java file in the form:	<moduleName>_modelName.java */
	String surfBuffer = "SurfaceDescs" + modelName;
	String surfBuffer1 = surfBuffer + ".java";
	
	
	FileWriter file1 = new FileWriter (surfBuffer1);
	BufferedWriter infoFileSurf = new BufferedWriter (file1);

	infoFileSurf.write("package com.ptc.otkjavaexamples;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcGeometry.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.cipjava.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcSession.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcCommand.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcGlobal.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcModel.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcModelItem.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcFeature.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcSolid.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import java.io.*;");
	infoFileSurf.newLine();
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcFamily.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcServer.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcWindow.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.wfc.wfcSolid.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcBase.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.wfc.wfcModel.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.wfc.wfcGeometry.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.wfc.wfcSolid.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.wfc.wfcPart.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcPart.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcDimension.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcAssembly.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcSelect.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcUnits.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcObject.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcUI.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcRelations.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcDetail.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcDrawing.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcView.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcView2D.*;");
	infoFileSurf.newLine();
	infoFileSurf.write("import com.ptc.pfc.pfcModel2D.*;");
	infoFileSurf.newLine();
	infoFileSurf.newLine();
	infoFileSurf.write("class " + surfBuffer);
	infoFileSurf.newLine();
	infoFileSurf.write("{");
	infoFileSurf.newLine();
	infoFileSurf.newLine();
	infoFileSurf.write("\tpublic " + surfBuffer + "()");
	infoFileSurf.newLine();
	infoFileSurf.write("\t{");
	infoFileSurf.newLine();
	infoFileSurf.write("\t}");
	infoFileSurf.newLine();
	infoFileSurf.newLine();
	infoFileSurf.write( "\tpublic static WSurfaceDescriptors OtkUtilSurfaceDescriptorCreate()");
	infoFileSurf.newLine();
	infoFileSurf.write("\t{");
	infoFileSurf.newLine();
	infoFileSurf.write("\t\ttry");
	infoFileSurf.newLine();
	infoFileSurf.write("\t\t{");
	infoFileSurf.newLine();

	
	infoFile.write("\t\twSurfDescs = " + surfBuffer +".OtkUtilSurfaceDescriptorCreate();");
	infoFile.newLine();

	if(SurfDescs != null) 
	{	
		otkCreateIntfDataUtils.CreateWfcSurfaceDescriptor(SurfDescs, "otkCreateIntfDataUtils", infoFileSurf);
	} 
	else 
	{
		infoFileSurf.write( "\t\treturn null;");
		infoFileSurf.newLine();
		infoFileSurf.write("\t\t}" );
		infoFileSurf.newLine();
		infoFileSurf.write("\t\tcatch (Exception e)" );
		infoFileSurf.newLine();
		infoFileSurf.write("\t\t{" );
		infoFileSurf.newLine();
		infoFileSurf.write("\t\tSystem.out.println(e);" );
		infoFileSurf.newLine();
		infoFileSurf.write("\t\t}" );
		infoFileSurf.newLine();
		infoFileSurf.write("\t\treturn null;" );
		infoFileSurf.newLine();
		infoFileSurf.write("\t}" );
		infoFileSurf.newLine();
		infoFileSurf.write("};" );
		infoFileSurf.newLine();
	}
	infoFileSurf.close();

	// ************************* Quilt Data ************************************ /
	QuiltDatas QuiltDatas = IntfData.GetQuiltData();
	infoFile.write("\t\tQuiltDatas wQuiltDatas = QuiltDatas.create();" );
	infoFile.newLine();


	/* Saving the java file in the form:	<moduleName>_modelName.java */
	String quiltBuffer = "QuiltDatas" + modelName;
	String quiltBuffer1 = quiltBuffer +".java";

	FileWriter file2 = new FileWriter (quiltBuffer1);
	BufferedWriter infoFileQuilt = new BufferedWriter (file2);

	infoFileQuilt.write("package com.ptc.otkjavaexamples;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcGeometry.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.cipjava.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcSession.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcCommand.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcGlobal.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcModel.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcModelItem.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcFeature.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcSolid.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import java.io.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcFamily.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcServer.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcWindow.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.wfc.wfcSolid.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcBase.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.wfc.wfcModel.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.wfc.wfcGeometry.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.wfc.wfcSolid.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.wfc.wfcPart.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcPart.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcDimension.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcAssembly.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcSelect.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcUnits.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcObject.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcUI.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcRelations.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcDetail.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcDrawing.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcView.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcView2D.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.write("import com.ptc.pfc.pfcModel2D.*;");
	infoFileQuilt.newLine();
	infoFileQuilt.newLine();
	infoFileQuilt.write("class " + quiltBuffer);
	infoFileQuilt.newLine();
	infoFileQuilt.write("{");
	infoFileQuilt.newLine();
	infoFileQuilt.newLine();
	infoFileQuilt.write("\tpublic " + quiltBuffer + "()");
	infoFileQuilt.newLine();
	infoFileQuilt.write("\t{");
	infoFileQuilt.newLine();
	infoFileQuilt.write("\t}");
	infoFileQuilt.newLine();
	infoFileQuilt.newLine();
	infoFileQuilt.write("\tpublic static QuiltDatas OtkUtilQuiltDatasCreate()");
	infoFileQuilt.newLine();
	infoFileQuilt.write("\t{");
	infoFileQuilt.newLine();
	infoFileQuilt.write("\t\ttry");
	infoFileQuilt.newLine();
	infoFileQuilt.write("\t\t{");
	infoFileQuilt.newLine();

	infoFile.write("\t\twQuiltDatas = " + quiltBuffer + ".OtkUtilQuiltDatasCreate();\n");
	infoFile.newLine();
	if(QuiltDatas != null) 
		otkCreateIntfDataUtils.CreateWfcQuiltDatas(QuiltDatas, "otkCreateIntfDataUtils", infoFileQuilt);
	 
	else
	{ 
		infoFileQuilt.write( "\t\treturn null;");
		infoFileQuilt.newLine();
		infoFileQuilt.write("\t\t}" );
		infoFileQuilt.newLine();
		infoFileQuilt.write("\t\tcatch (Exception e)" );
		infoFileQuilt.newLine();
		infoFileQuilt.write("\t\t{" );
		infoFileQuilt.newLine();
		infoFileQuilt.write("\t\tSystem.out.println(e);" );
		infoFileQuilt.newLine();
		infoFileQuilt.write("\t\t}" );
		infoFileQuilt.newLine();
		infoFileQuilt.write("\t\treturn null;" );
		infoFileQuilt.newLine();
		infoFileQuilt.write("\t}" );
		infoFileQuilt.newLine();
		infoFileQuilt.write("};" );
		infoFileQuilt.newLine();
	}
	infoFileQuilt.close();

	// ************************* Edge Descriptor ************************************ /
	EdgeDescriptors EdgeDescs = IntfData.GetEdgeDescriptor();
	infoFile.write("\t\tEdgeDescriptors wEdgeDescs = EdgeDescriptors.create();" );
	infoFile.newLine();

	/* Saving the java file in the form:	<moduleName>_modelName.java */
	String edgeBuffer = "EdgeDescs" + modelName;
	String edgeBuffer1 = edgeBuffer + ".java";

	FileWriter file3 = new FileWriter (edgeBuffer1);
	BufferedWriter infoFileEdge = new BufferedWriter (file3);

	infoFileEdge.write("package com.ptc.otkjavaexamples;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcGeometry.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.cipjava.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcSession.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcCommand.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcGlobal.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcModel.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcModelItem.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcFeature.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcSolid.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import java.io.*;");
	infoFileEdge.newLine();
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcFamily.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcServer.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcWindow.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.wfc.wfcSolid.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcBase.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.wfc.wfcModel.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.wfc.wfcGeometry.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.wfc.wfcSolid.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.wfc.wfcPart.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcPart.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcDimension.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcAssembly.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcSelect.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcUnits.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcObject.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcUI.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcRelations.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcDetail.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcDrawing.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcView.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcView2D.*;");
	infoFileEdge.newLine();
	infoFileEdge.write("import com.ptc.pfc.pfcModel2D.*;");
	infoFileEdge.newLine();
	infoFileEdge.newLine();
	infoFileEdge.write("class " + edgeBuffer);
	infoFileEdge.newLine();
	infoFileEdge.write("{");
	infoFileEdge.newLine();
	infoFileEdge.newLine();
	infoFileEdge.write("\tpublic " + edgeBuffer + "()");
	infoFileEdge.newLine();
	infoFileEdge.write("\t{");
	infoFileEdge.newLine();
	infoFileEdge.write("\t}");
	infoFileEdge.newLine();
	infoFileEdge.newLine();
	infoFileEdge.write("\tpublic static EdgeDescriptors OtkUtilEdgeDescriptorCreate()");
	infoFileEdge.newLine();
	infoFileEdge.write("\t{");
	infoFileEdge.newLine();
	infoFileEdge.write("\t\ttry");
	infoFileEdge.newLine();
	infoFileEdge.write("\t\t{");
	infoFileEdge.newLine();
	
	infoFile.write("\t\t wEdgeDescs = " + edgeBuffer + ".OtkUtilEdgeDescriptorCreate();\n" );
	infoFile.newLine();
	if(EdgeDescs != null)
	{
		otkCreateIntfDataUtils.CreateWfcEdgeDescriptor(EdgeDescs, "otkCreateIntfDataUtils", infoFileEdge);
	} 
	else 
	{
		infoFileEdge.write( "\t\treturn null;");
		infoFileEdge.newLine();
		infoFileEdge.write("\t\t}" );
		infoFileEdge.newLine();
		infoFileEdge.write("\t\tcatch (Exception e)" );
		infoFileEdge.newLine();
		infoFileEdge.write("\t\t{" );
		infoFileEdge.newLine();
		infoFileEdge.write("\t\tSystem.out.println(e);" );
		infoFileEdge.newLine();
		infoFileEdge.write("\t\t}" );
		infoFileEdge.newLine();
		infoFileEdge.write("\t\treturn null;" );
		infoFileEdge.newLine();
		infoFileEdge.write("\t}" );
		infoFileEdge.newLine();
		infoFileEdge.write("};" );
		infoFileEdge.newLine();
	}
	infoFileEdge.close();

	// ************************* Datum Data ************************************ /
	DatumDatas DatumDatas = IntfData.GetDatumData();
	int j = 1;

	infoFile.write("\t\tDatumDatas wDatumDatas = DatumDatas.create();" );
	infoFile.newLine();
	if(DatumDatas != null)
	{
		for(int i = 0; i < DatumDatas.getarraysize(); i++)
		{			
			DatumData DatumData = DatumDatas.get(i);
			DatumObject DatumObject = DatumData.GetDatumObject();
			DatumObjectType DatumObjType = DatumObject.GetDatumObjectType();
			
			switch(DatumObjType.getValue())
			{
				case DatumObjectType._DATUM_CURVE:
				{
					CurveDatumObject CurveObject = (CurveDatumObject)(DatumObject);
					CurveDescriptor CurveDesc = CurveObject.GetCurve();
					otkCreateIntfDataUtils.CreateCurveDescriptor(CurveDesc, i, "WD", "otkCreateIntfDataUtils", infoFile);					
					infoFile.write("\t\tCurveDatumObject WCurveObject"  + j  + " = wfcGeometry.CurveDatumObject_Create(WDCurveDesc" + j  + ");" );
					infoFile.newLine();
					infoFile.write("\t\tDatumObject WDatumObject"  + j  + " = (DatumObject)(WCurveObject" + j  + ");" );
					infoFile.newLine();
					infoFile.newLine();

					j++;
					break;
				}
				case DatumObjectType._DATUM_PLANE:
				{					
					PlaneDatumObject PlaneObject = (PlaneDatumObject)(DatumObject);
					WPlaneData PlaneData = PlaneObject.GetPlaneData();
					
					Vector3D XAxis = PlaneData.GetXAxis();
					Vector3D YAxis = PlaneData.GetYAxis();
					Vector3D ZAxis = PlaneData.GetZAxis();
					Point3D Origin = PlaneData.GetOrigin();

					infoFile.write("\t\tVector3D wXAxis" + j +" = otkCreateIntfDataUtils.CreatePfcVector3D ( " + XAxis.get(0)  + " , " + XAxis.get(1)  + " , " + XAxis.get(2)  + " );");					
					infoFile.newLine();
					infoFile.write("\t\tVector3D wYAxis" + j +" = otkCreateIntfDataUtils.CreatePfcVector3D ( " + YAxis.get(0)  + " , " + YAxis.get(1)  + " , " + YAxis.get(2)  + " );");
					infoFile.newLine();
					infoFile.write("\t\tVector3D wZAxis" + j +" = otkCreateIntfDataUtils.CreatePfcVector3D ( " + ZAxis.get(0)  + " , " + ZAxis.get(1)  + " , " + ZAxis.get(2)  + " );");
					infoFile.newLine();
					infoFile.write("\t\tPoint3D wOrigin" + j +" = otkCreateIntfDataUtils.CreatePfcPoint3D( " + Origin.get(0)  + " , "  + Origin.get(1)  + " , "  + Origin.get(2)  + " );\n" );
					infoFile.newLine();
					
					infoFile.write("\t\tWPlaneData WPlaneData" + j  +" = wfcGeometry.WPlaneData_Create(wXAxis" + j  +", wYAxis" + j  +", wZAxis" + j  +", wOrigin" + j  +");" );					
					infoFile.newLine();
					infoFile.write("\t\tPlaneDatumObject WPlaneObject"  + j  + " = wfcGeometry.PlaneDatumObject_Create(WPlaneData" + j  + ");" );
					infoFile.newLine();
					infoFile.write("\t\tDatumObject WDatumObject"  + j  + " = (DatumObject)(WPlaneObject" + j  + ");\n" );
					infoFile.newLine();
					
					j++;	
					break;
				}
				case DatumObjectType._DATUM_CSYS:
				{
					CsysDatumObject CsysObject = (CsysDatumObject)(DatumObject);
					WCsysData CsysData = CsysObject. GetCsysData();
					
					Vector3D XAxis = CsysData.GetXAxis();
					Vector3D YAxis = CsysData.GetYAxis();
					Vector3D ZAxis = CsysData.GetZAxis();
					Vector3D Origin = CsysData.GetOrigin();

					infoFile.write("\t\tVector3D wXAxis" + j +" = otkCreateIntfDataUtils.CreatePfcVector3D ( " + XAxis.get(0)  + " , " + XAxis.get(1)  + " , " + XAxis.get(2)  + " );");					
					infoFile.newLine();
					infoFile.write("\t\tVector3D wYAxis" + j +" = otkCreateIntfDataUtils.CreatePfcVector3D ( " + YAxis.get(0)  + " , " + YAxis.get(1)  + " , " + YAxis.get(2)  + " );");
					infoFile.newLine();
					infoFile.write("\t\tVector3D wZAxis" + j +" = otkCreateIntfDataUtils.CreatePfcVector3D ( " + ZAxis.get(0)  + " , " + ZAxis.get(1)  + " , " + ZAxis.get(2)  + " );");
					infoFile.newLine();
					infoFile.write("\t\tVector3D wOrigin" + j +" = otkCreateIntfDataUtils.CreatePfcVector3D( " + Origin.get(0)  + " , "  + Origin.get(1)  + " , "  + Origin.get(2)  + " );\n" );
					infoFile.newLine();
					
					infoFile.write("\t\tWCsysData WCsysData" + j  +" = wfcGeometry.WCsysData_Create(wXAxis" + j  +", wYAxis" + j  +", wZAxis" + j  +", wOrigin" + j  +");" );					
					infoFile.newLine();
					infoFile.write("\t\tCsysDatumObject WCsysObject"  + j  + " = wfcGeometry.CsysDatumObject_Create(WCsysData" + j  + ");" );
					infoFile.newLine();
					infoFile.write("\t\tDatumObject WDatumObject"  + j  + " = (DatumObject)(WCsysObject" + j  + ");\n" );
					infoFile.newLine();
					
					j++;
					break;
				}
			}								
			infoFile.write("\t\tDatumData WDatumData"  + (i+1)  + " = wfcGeometry.DatumData_Create(" + DatumData.GetId()  +" , \""  + DatumData.GetName()  + "\" , WDatumObject"  + (i+1)  + ");" );			
			infoFile.newLine();
			infoFile.write("\t\twDatumDatas.append(WDatumData" + (i+1)  +");\n");
			infoFile.newLine();
		} // for(int i)
	} else {
		infoFile.write("\t\twDatumDatas = 0;" );
	}

	// ************************* Accuracy and Outline ************************************ /
	Outline3D Outline = IntfData.GetOutline();
	Point3D Point1 = Outline.get(0);
	Point3D Point2 = Outline.get(1);

	infoFile.write("\t\tOutline3D wOutline = Outline3D.create();" );
	infoFile.newLine();
	infoFile.write("\t\tPoint3D wPoint1 = otkCreateIntfDataUtils.CreatePfcPoint3D( " + Point1.get(0)  + ", "  + Point1.get(1)  + ", "  + Point1.get(2)  + " );" );
	infoFile.newLine();
	infoFile.write("\t\tPoint3D wPoint2 = otkCreateIntfDataUtils.CreatePfcPoint3D( " + Point2.get(0)  + ", "  + Point2.get(1)  + ", "  + Point2.get(2)  + " );" );
	infoFile.newLine();
	infoFile.write("\t\twOutline.set(0, wPoint1);" );
	infoFile.newLine();
	infoFile.write("\t\twOutline.set(1, wPoint2);" );
	infoFile.newLine();
	infoFile.newLine();
	
	infoFile.write("\t\tDouble value = new Double(" + IntfData.GetAccuracy() + ");" );
	infoFile.write("\t\tInterfaceData InterfaceData = wfcModel.InterfaceData_Create(wSurfDescs, wEdgeDescs, wQuiltDatas, wDatumDatas, "  + otkTypeEnums.AccuracyTypeGet(IntfData.GetAccuracytype().getValue()) + ", "  + "value"  + ", wOutline);" );
	infoFile.newLine();
	infoFile.write("\t\treturn(InterfaceData);" );
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\tcatch (Exception e)" );
	infoFile.newLine();
	infoFile.write("\t\t{" );
	infoFile.newLine();
	infoFile.write("\t\tSystem.out.println(e);" );
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\treturn null;" );
	infoFile.newLine();
	infoFile.write("\t}" );
	infoFile.newLine();
	infoFile.write("};" );
	infoFile.newLine();
	
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************* /
// creates a wfcsurface descriptor data
public static void CreateWfcSurfaceDescriptor(WSurfaceDescriptors SurfaceDescs, String className, BufferedWriter infoFile)
{
	try
	{
	infoFile.write(" \t\tWSurfaceDescriptors wSurfDescs = WSurfaceDescriptors.create();");
	infoFile.newLine();
	infoFile.write("\t\tint[] nums;");
	infoFile.newLine();
	for(int i =0; i < SurfaceDescs.getarraysize(); i++)
	{
		WSurfaceDescriptor SurfDesc = SurfaceDescs.get(i);
		otkCreateIntfDataUtils.CreateSurfaceDescriptor(SurfDesc, i, "WS", className, infoFile);
		infoFile.write("\t\twSurfDescs.append(WSSurfDesc" + (i+1)  + ");" );
		infoFile.newLine();
		infoFile.newLine();
	}
	infoFile.write("\t\treturn(wSurfDescs);");
	infoFile.newLine();
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\tcatch (Exception e)" );
	infoFile.newLine();
	infoFile.write("\t\t{" );
	infoFile.newLine();
	infoFile.write("\t\tSystem.out.println(e);" );
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\treturn null;" );
	infoFile.newLine();
	infoFile.write("\t}" );
	infoFile.newLine();
	infoFile.write("};" );
	infoFile.newLine();
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************** /
// creates a wfcQuilt data
public static void CreateWfcQuiltDatas(QuiltDatas Quiltdatas, String className, BufferedWriter infoFile)
{
	try
	{

	infoFile.write(" \t QuiltDatas wQuiltDatas = QuiltDatas.create();");
	infoFile.newLine();
	infoFile.write("\t\tint[] nums;");
	infoFile.newLine();
	for(int i = 0; i < Quiltdatas.getarraysize(); i++)
	{
		QuiltData QuiltData = Quiltdatas.get(i);
		WSurfaceDescriptors QSurfDescs = QuiltData.GetSurfaceDescriptors();
		infoFile.write("\t\tWSurfaceDescriptors WQSurfaceDescs" + (i+1) +" = WSurfaceDescriptors.create();");
		infoFile.newLine();
		if(QSurfDescs != null)
		{
			String nstring = "WQS" + (i+1) + "_";
			for(int j =0; j < QSurfDescs.getarraysize(); j++)
			{
				WSurfaceDescriptor QSurfDesc = QSurfDescs.get(j);
				otkCreateIntfDataUtils.CreateSurfaceDescriptor(QSurfDesc, j, nstring, className, infoFile);
				infoFile.write("\t\tWQSurfaceDescs" + (i+1) +".append(" +nstring +"SurfDesc" + (j+1)  + ");\n" );
				infoFile.newLine();
				infoFile.newLine();
			}
		}
		else
			infoFile.write("\t\tWQSurfaceDescs" + (i+1) +" = 0;");
			infoFile.newLine();

		infoFile.write("\t\tQuiltData WQuiltData" +(i+1) + " = wfcGeometry.QuiltData_Create(WQSurfaceDescs" +(i+1) +", " +QuiltData.GetQuiltId() +");");
		infoFile.newLine();
		infoFile.write("\t\twQuiltDatas.append(WQuiltData" +(i+1) +");\n");
		infoFile.newLine();
		infoFile.newLine();
	}

	infoFile.write("\t\treturn(wQuiltDatas);");
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\tcatch (Exception e)" );
	infoFile.newLine();
	infoFile.write("\t\t{" );
	infoFile.newLine();
	infoFile.write("\t\tSystem.out.println(e);" );
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\treturn null;" );
	infoFile.newLine();
	infoFile.write("\t}" );
	infoFile.newLine();
	infoFile.write("};" );
	infoFile.newLine();
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************** /
// creates a wfcEdge descriptor data
public static void CreateWfcEdgeDescriptor(EdgeDescriptors EdgeDescs, String className, BufferedWriter infoFile)
{
	try
	{
	infoFile.write("\t\tEdgeDescriptors wEdgeDescs = EdgeDescriptors.create();");
	infoFile.newLine();
	for(int i = 0; i < EdgeDescs.getarraysize(); i++)
	{
		EdgeDescriptor  EdgeDesc = EdgeDescs.get(i);
		EdgeSurfaceData  EdgeSurfData1 = EdgeDesc.GetEdgeSurface1();
		otkCreateIntfDataUtils.CreateEdgeSurfaceData(EdgeSurfData1, 1, i, className, infoFile);

		EdgeSurfaceData  EdgeSurfData2 = EdgeDesc.GetEdgeSurface2();
		otkCreateIntfDataUtils.CreateEdgeSurfaceData(EdgeSurfData2, 2, i, className, infoFile);
		
		CurveDescriptor  XYZCurveData = EdgeDesc.GetXYZCurveData();
		if(XYZCurveData != null)
		{
			infoFile.write("\t\t// Curve Descriptor in Edge Descriptor " );
			infoFile.newLine();
			otkCreateIntfDataUtils.CreateCurveDescriptor(XYZCurveData, i, "WEC", className, infoFile);
			infoFile.write("\t\tEdgeDescriptor wEdgeDesc" + (i+1) + " = wfcGeometry.EdgeDescriptor_Create(" + EdgeDesc.GetId() + ", wEdgeSurfaceData1_" + (i+1) + ", wEdgeSurfaceData2_" + (i+1) + ", WECCurveDesc" + (i+1) + ");") ;
			infoFile.newLine();
		} else {
			infoFile.write("\t\tCurveDescriptor  WECCurveDesc"  + (i+1)  +" = 0;" );
			infoFile.newLine();
		}
	
		infoFile.write("\t\twEdgeDescs.append(wEdgeDesc"  + (i+1)  + ");\n" );
		infoFile.newLine();
	}
	infoFile.write("\t\treturn(wEdgeDescs);");
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\tcatch (Exception e)" );
	infoFile.newLine();
	infoFile.write("\t\t{" );
	infoFile.newLine();
	infoFile.write("\t\tSystem.out.println(e);" );
	infoFile.newLine();
	infoFile.write("\t\t}" );
	infoFile.newLine();
	infoFile.write("\t\treturn null;" );
	infoFile.newLine();
	infoFile.write("\t}" );
	infoFile.newLine();
	infoFile.write("};" );
	infoFile.newLine();;
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************** /
// creates a edge surface data
public static void CreateEdgeSurfaceData (EdgeSurfaceData  EdgeSurfData, int count, int i, String className, BufferedWriter edgeInfoFile)
{
	try
	{
	
	String nstring = "WED" + count;

	if(EdgeSurfData.GetUVParamsSequence() != null)
	{
		UVParamsSequence  UVParamSequence = EdgeSurfData.GetUVParamsSequence();
		edgeInfoFile.write("\t\tUVParamsSequence  wUVParamSequence"  + count  +"_" + (i+1)  +" = UVParamsSequence.create();" );
		edgeInfoFile.newLine();
		
		int ParamCount = 0;
		double param1 = 0;
		double param2 = 0;
		
		for(int j = 0; j < UVParamSequence.getarraysize(); j++)
		{
			 param1 = (UVParamSequence.get(0)).get(0);
			 param2 = (UVParamSequence.get(0)).get(1);
			 
			 if((UVParamSequence.get(j)).get(0) == param1 && (UVParamSequence.get(j)).get(1) == param2)
			{
				ParamCount++;
			} else {
				edgeInfoFile.write("\t\totkCreateIntfDataUtils.CreatePfcUVParamsSeq(" +(UVParamSequence.get(j)).get(0)  +", "  + (UVParamSequence.get(j)).get(1) +", " +"wUVParamSequence" + count  +"_" + (i+1) +");" );
				edgeInfoFile.newLine();
			}
		}// for(int j)
		if(param1 != 0 && param2 != 0 && ParamCount >= 2)
		{
			edgeInfoFile.write("\t\totkCreateIntfDataUtils.CreatePfcUVParamsSeqArr(" + ParamCount + ", "+(UVParamSequence.get(0)).get(0) +", " + (UVParamSequence.get(0)).get(1)+", "+"wUVParamSequence"+ count +"_"+ (i+1)+");" );
			edgeInfoFile.newLine();
		}	
			
	}
	
	else 
	{
		edgeInfoFile.write("\t\tUVParamsSequence  wUVParamSequence" + count  +"_" + (i+1)  + " = 0;");
		edgeInfoFile.newLine();
	}

	if(EdgeSurfData.GetUVCurveData() != null)
	{
		CurveDescriptor  CurveDesc = EdgeSurfData.GetUVCurveData();
	    otkCreateIntfDataUtils.CreateCurveDescriptor(CurveDesc, i, nstring, className, edgeInfoFile);
		edgeInfoFile.write("\t\tEdgeSurfaceData  wEdgeSurfaceData"  + count  + "_" +(i+1) +" = wfcGeometry.EdgeSurfaceData_Create(" + EdgeSurfData.GetEdgeSurfaceId()  + ", " + otkTypeEnums.EdgeDirectionTypeGet(EdgeSurfData.GetDirection().getValue())  + ", wUVParamSequence" + count  +"_" + (i+1)  + ", "  + nstring +"CurveDesc" +(i+1) +");");
		edgeInfoFile.newLine();
	} else {
		edgeInfoFile.write("\t\tEdgeSurfaceData  wEdgeSurfaceData"  + count  + "_" +(i+1) +" = wfcGeometry.EdgeSurfaceData_Create(" + EdgeSurfData.GetEdgeSurfaceId()  + ", " + otkTypeEnums.EdgeDirectionTypeGet(EdgeSurfData.GetDirection().getValue())  + ", wUVParamSequence" + count  +"_" + (i+1) + ", null);");
		edgeInfoFile.newLine();
		edgeInfoFile.newLine();
	}
	
	edgeInfoFile.newLine();
	edgeInfoFile.newLine();
	return;
	}
	
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************** /
// creates a curve descriptor data
public static void CreateCurveDescriptor (CurveDescriptor  CurveDesc, int i, String string, String className, BufferedWriter curveInfoFile)
{	
	try
	{

	CurveType curveType = CurveDesc.GetCurveType();
	switch(curveType.getValue()) 
	{
		case CurveType._CURVE_COMPOSITE:
		{
			curveInfoFile.write("\t\t// type : CURVE_COMPOSITE");
			curveInfoFile.newLine();			
			CompositeCurveDescriptor  pCompCurveDesc = (CompositeCurveDescriptor)(CurveDesc);
			WCompositeCurveDescriptor  CompCurveDesc = (WCompositeCurveDescriptor)(pCompCurveDesc);
		

			CurveDescriptors  CurveDescs = CompCurveDesc.GetElements();

			curveInfoFile.write("\t\tCurveDescriptors  pCurveDescs" +(i+1) +" = CurveDescriptors.create();" );
			curveInfoFile.newLine();
			for(int j = 0; j < CurveDescs.getarraysize();j++)
			{							
				String cString = "WDComp_" + (i+1);
			
				otkCreateIntfDataUtils.CreateCompCurveDescriptor (CurveDescs.get(j), j, cString, className, curveInfoFile);
				curveInfoFile.write("\t\tpCurveDescs" +(i+1) +".append(" + cString +"CurveDesc" + (j+1) +");\n" );
				curveInfoFile.newLine();
			}
			
			CurveDirections  CompDirs = CompCurveDesc.GetCompDirections();
			curveInfoFile.write("\t\tCurveDirections  " +string +"CompDirs" +(i+1) +" = CurveDirections.create();" );
			curveInfoFile.newLine();
			for(int k = 0; k < CompDirs.getarraysize(); k++)
			{
				curveInfoFile.write("\t\t" +string +"CompDirs" +(i+1) +".append(" +otkTypeEnums.CurveDirectionGet(CompDirs.get(k).getValue()) +");" );
				curveInfoFile.newLine();
			}

			curveInfoFile.write("\t\tWCompositeCurveDescriptor  " + string +"wCompCurveDesc" +(i+1) +" = wfcGeometry.WCompositeCurveDescriptor_Create(pCurveDescs" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\t " +string +"wCompCurveDesc" +(i+1) +".SetCompDirections(" +string +"CompDirs" + (i+1) +");" );	
			curveInfoFile.newLine();
			
			curveInfoFile.write("\t\tCompositeCurveDescriptor  " +string +"CompCurveDesc" +(i+1) +" = (CompositeCurveDescriptor)(" +string +"wCompCurveDesc" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"CompCurveDesc" +(i+1) +"); " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_POINT:
		{
			curveInfoFile.write("\t\t// type : CURVE_POINT");
			curveInfoFile.newLine();
			PointDescriptor  PointDesc = (PointDescriptor)(CurveDesc);
			Point3D  Point = PointDesc.GetPoint ();
			curveInfoFile.write("\t\tPoint3D  " +string +"Point" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + " );" );
			curveInfoFile.newLine();
			
			curveInfoFile.write("\t\tPointDescriptor  " +string +"PointDesc" +(i+1) +" = pfcGeometry.PointDescriptor_Create(" +string +"Point" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"PointDesc" +(i+1) +");\n " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_LINE:
		{
			curveInfoFile.write("\t\t// type : CURVE_LINE");
			curveInfoFile.newLine();
			
			LineDescriptor  LineDesc = (LineDescriptor)(CurveDesc);
			Point3D  Point1 = LineDesc.GetEnd1 ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"Point1" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point1.get(0)  + " , "  + Point1.get(1)  + " , "  + Point1.get(2)  + " );" );
			curveInfoFile.newLine();
			
			Point3D  Point2 = LineDesc.GetEnd2 ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"Point2" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point2.get(0)  + " , "  + Point2.get(1)  + " , "  + Point2.get(2)  + " );" );
			curveInfoFile.newLine();
			
			curveInfoFile.write("\t\tLineDescriptor  " +string +"LineDesc" +(i+1) +" = pfcGeometry.LineDescriptor_Create(" +string +"Point1" +(i+1) +", " +string +"Point2" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"LineDesc" +(i+1) +"); " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_ARROW:
		{
			curveInfoFile.write("\t\t// type : CURVE_ARROW");
			curveInfoFile.newLine();
			
			ArrowDescriptor  ArrowDesc = (ArrowDescriptor)(CurveDesc);
			Point3D  Point1 = ArrowDesc.GetEnd1 ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"Point1" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point1.get(0)  + " , "  + Point1.get(1)  + " , "  + Point1.get(2)  + " );" );
			curveInfoFile.newLine();
			
			Point3D  Point2 = ArrowDesc.GetEnd2 ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"Point2" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point2.get(0)  + " , "  + Point2.get(1)  + " , "  + Point2.get(2)  + " );" );
			curveInfoFile.newLine();

			curveInfoFile.write("\t\tArrowDescriptor  " +string +"ArrowDesc" +(i+1) +" = pfcGeometry.ArrowDescriptor_Create(" +string +"Point1" +(i+1) +", " +string +"Point2" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"ArrowDesc" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_ARC:
		{
			curveInfoFile.write("\t\t// type : CURVE_ARC");
			curveInfoFile.newLine();
			
			ArcDescriptor  ArcDesc = (ArcDescriptor)(CurveDesc);
			Vector3D  Vector1 = ArcDesc.GetVector1 ();
			
			curveInfoFile.write("\t\tVector3D  " +string +"ArcVector1" +(i+1) +" = " +className +".CreatePfcVector3D( " + Vector1.get(0)  + " , "  + Vector1.get(1)  + " , "  + Vector1.get(2)  + " );" );
			curveInfoFile.newLine();
			
			Vector3D  Vector2 = ArcDesc.GetVector2 ();
			
			curveInfoFile.write("\t\tVector3D  " +string +"ArcVector2" +(i+1) +" = " +className +".CreatePfcVector3D( " + Vector2.get(0)  + " , "  + Vector2.get(1)  + " , "  + Vector2.get(2)  + " );" );
			curveInfoFile.newLine();
			
			Point3D  Point = ArcDesc.GetCenter ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"ArcPoint" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + " );" );
			curveInfoFile.newLine();

			curveInfoFile.write("\t\tArcDescriptor  " +string +"ArcDesc" +(i+1) +" = pfcGeometry.ArcDescriptor_Create(" +string +"ArcVector1" +(i+1) +", " +string +"ArcVector2" +(i+1) +", " +string +"ArcPoint" +(i+1) +","  + ArcDesc.GetStartAngle()  + ", "  + ArcDesc.GetEndAngle()  + ", "  + ArcDesc.GetRadius() + " );" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"ArcDesc" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_SPLINE:
		{
			curveInfoFile.write("\t\t// type : CURVE_SPLINE");
			curveInfoFile.newLine();
			
			SplineDescriptor  SplineDesc = (SplineDescriptor)(CurveDesc);
						
			SplinePoints  SplPoints = SplineDesc.GetPoints();
			
			otkCreateIntfDataUtils.CreateSplinePoints(SplPoints, i, string, className, curveInfoFile);

			curveInfoFile.write("\t\tSplineDescriptor  " +string +"splineDesc" +(i+1) +" = pfcGeometry.SplineDescriptor_Create(" +string +"SplPoints" +(i+1) +");");
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"splineDesc" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_BSPLINE:
		{
			curveInfoFile.write("\t\t// type : CURVE_BSPLINE");
			curveInfoFile.newLine();
			BSplineDescriptor  bSplineDesc = (BSplineDescriptor)(CurveDesc);
			
			curveInfoFile.write("\t\tBSplinePoints  " +string +"BSplPoints" + (i+1)  +" = BSplinePoints.create();" );
			curveInfoFile.newLine();
			BSplinePoints  bSplPoints = bSplineDesc.GetPoints();
			for(int k = 0; k < bSplPoints.getarraysize(); k++)
			{
				BSplinePoint  bSplPoint = bSplPoints.get(k);

				Point3D  Point1 = bSplPoint.GetPoint();
				curveInfoFile.write("\t\tPoint3D  " +string +"BPoint" +(i+1) +"_" + (k+1) +" = " +className +".CreatePfcPoint3D( " + Point1.get(0)  + " , "  + Point1.get(1)  + " , "  + Point1.get(2)  + " );" );	
				curveInfoFile.newLine();
				
				if(bSplPoint.GetWeight() != null)
				{
					curveInfoFile.write("\t\tBSplinePoint  " +string +"BSplPoint" +(i+1) +"_" + (k+1) +" = pfcGeometry.BSplinePoint_Create(" +string  +"BPoint" + (i+1)  +"_" + (k+1)  +", " +bSplPoint.GetWeight() +");" );
					curveInfoFile.newLine();
				} 
				else 
				{
					curveInfoFile.write("\t\tBSplinePoint  " +string +"BSplPoint" +(i+1) +"_" + (k+1) +" = pfcGeometry.BSplinePoint_Create(" + string +"BPoint" + (i+1)  +"_" + (k+1)  +", null);" );
					curveInfoFile.newLine();
				}
				curveInfoFile.write("\t\t" +string +"BSplPoints" +(i+1) +".append(" +string +"BSplPoint" +(i+1) +"_" + (k+1) +");");
				curveInfoFile.newLine();
			}			
			realseq  splKnots = bSplineDesc.GetKnots();
			curveInfoFile.write("\t\trealseq  " +string +"BSplKnots" + (i+1)  +" = realseq.create();" );
			curveInfoFile.newLine();
			for(int l = 0; l < splKnots.getarraysize(); l++)
			{
				curveInfoFile.write("\t\t" +string +"BSplKnots" + (i+1) +".append(" +splKnots.get(l) +");" );
				curveInfoFile.newLine();
			}

			curveInfoFile.write("\t\tBSplineDescriptor  " +string +"BSplineDesc" +(i+1) +" = pfcGeometry.BSplineDescriptor_Create(" +bSplineDesc.GetDegree() +", " +string +"BSplPoints" +(i+1) +", " +string  +"BSplKnots" +(i+1) +");");
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"BSplineDesc" +(i+1) +");\n " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_CIRCLE:
		{
			curveInfoFile.write("\t\t// type : CURVE_CIRCLE");
			curveInfoFile.newLine();
			
			CircleDescriptor  CircleDesc = (CircleDescriptor)(CurveDesc);
			Point3D  Point = CircleDesc.GetCenter ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"Point" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + " );" );
			curveInfoFile.newLine();
			
			Vector3D  Vector1 = CircleDesc.GetUnitNormal ();
			
			curveInfoFile.write("\t\tVector3D  " +string +"Vector" +(i+1) +" = " +className +".CreatePfcVector3D( " + Vector1.get(0)  + " , "  + Vector1.get(1)  + " , "  + Vector1.get(2)  + " );" );
			curveInfoFile.newLine();

			curveInfoFile.write("\t\tCircleDescriptor  " +string +"CircleDesc" +(i+1) +" = pfcGeometry.CircleDescriptor_Create(" +string +"Point" +(i+1) +", " + CircleDesc.GetRadius()  + ", " +string +"Vector" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"CircleDesc" +(i+1) +"); " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_ELLIPSE:
		{
			curveInfoFile.write("\t\t// type : CURVE_ELLIPSE");
			curveInfoFile.newLine();
			
			EllipseDescriptor  EllipDesc = (EllipseDescriptor)(CurveDesc);
			Vector3D  Vector1 = EllipDesc.GetUnitMajorAxis ();
			
			curveInfoFile.write("\t\tVector3D  " +string +"Vector1" +(i+1) +" = " +className +".CreatePfcVector3D( " + Vector1.get(0)  + " , "  + Vector1.get(1)  + " , "  + Vector1.get(2)  + " );" );
			curveInfoFile.newLine();
			
			Vector3D  Vector2 = EllipDesc.GetUnitNormal ();
			
			curveInfoFile.write("\t\tVector3D  " +string +"Vector2" +(i+1) +" = " +className +".CreatePfcVector3D( " + Vector2.get(0)  + " , "  + Vector2.get(1)  + " , "  + Vector2.get(2)  + " );" );
			curveInfoFile.newLine();
			
			Point3D  Point = EllipDesc.GetCenter ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"Point" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + " );" );
			curveInfoFile.newLine();

			curveInfoFile.write("\t\tEllipseDescriptor  " +string +"EllipDesc" +(i+1) +" = pfcGeometry.EllipseDescriptor_Create(" +string +"Point" +(i+1) +", " +string +"Vector1" +(i+1) +", " +string +"Vector2" +(i+1) +", "  + EllipDesc.GetMajorLength()  + ", "  + EllipDesc.GetMinorLength()  + ", "  + EllipDesc.GetStartAngle() + ", "  + EllipDesc.GetEndAngle() +" );" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"EllipDesc" +(i+1) +");\n " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_POLYGON:
		{
			curveInfoFile.write("\t\t// type : CURVE_POLYGON");
			curveInfoFile.newLine();
			
			PolygonDescriptor  PolygDesc = (PolygonDescriptor)(CurveDesc);
			Point3Ds  Points = PolygDesc.GetVertices();
			
			curveInfoFile.write("Point3Ds  " +string +"Points" +(i+1) +" = Point3Ds.create();" );
			curveInfoFile.newLine();
			for(int j = 0; j < Points.getarraysize(); j++)
			{
				Point3D  Point = Points.get(j);
				curveInfoFile.write("\t\tPoint3D  " +string +"Point" +  (j+1) +"_" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + " );" );
				curveInfoFile.newLine();
				curveInfoFile.write("\t\t" +string +"Points" +(i+1) +".append(" +string +"Point"  +  (j+1)  + "_" +(i+1) +");" );
				curveInfoFile.newLine();
			}
			curveInfoFile.newLine();
			curveInfoFile.write("\n\t PolygonDescriptor  " +string +"PolygDesc" +(i+1) +" = pfcGeometry.PolygonDescriptor_Create(" +string +"Points" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"PolygDesc" +(i+1) +");\n " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
		case CurveType._CURVE_TEXT:
		{
			curveInfoFile.write("\t\t// type : CURVE_TEXT");
			curveInfoFile.newLine();
			
			TextDescriptor  TextDesc = (TextDescriptor)(CurveDesc);
			Point3D  Point = TextDesc.GetPoint ();
			
			curveInfoFile.write("\t\tPoint3D  " +string +"Point" +(i+1) +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + " );" );
			curveInfoFile.newLine();
			
			TextStyle  TextStyle = TextDesc.GetStyle();
			
			curveInfoFile.write("\t\tTextStyle  " +string +"TextStyle" +(i+1) +" = new TextStyle("  + TextStyle.GetAngle()  + ", \" " + TextStyle.GetFontName() + " \", " + TextStyle.GetHeight()  + ", "  + TextStyle.GetWidthFactor()  + ", "  + TextStyle.GetSlantAngle()  + ", "  + TextStyle.GetThickness()  + ", "  + TextStyle.GetIsUnderlined()  + ", "  + TextStyle.GetIsMirrored()  + ");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tTextDescriptor  " +string +"TextDesc" +(i+1) +" = pfcGeometry.TextDescriptor_Create(\"_"  + TextDesc.GetTextString() + "\", " +string +"Point" +(i+1) +", " +string +"TextStyle" +(i+1) +");" );
			curveInfoFile.newLine();
			curveInfoFile.write("\t\tCurveDescriptor  " +string +"CurveDesc" +(i+1) +" = (CurveDescriptor)(" +string +"TextDesc" +(i+1) +");\n " );
			curveInfoFile.newLine();
			curveInfoFile.newLine();
			break;
		}
	}
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************** /
// creates a composite curve data
public static void CreateCompCurveDescriptor (CurveDescriptor  CurveDesc, int i, String string, String className, BufferedWriter ccInfoFile)
{
	try
	{
	otkCreateIntfDataUtils.CreateCurveDescriptor(CurveDesc, i, string, className, ccInfoFile);
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
	
}

// ************************************************************************************************** /
// creates a surface descriptor data
public static void CreateSurfaceDescriptor(WSurfaceDescriptor  SurfDesc, int i, String string, String className, BufferedWriter surfInfoFile)
{
	try
	{
	
	ContourDescriptors ContDatas = SurfDesc.GetContourData();
	surfInfoFile.newLine();
	surfInfoFile.write("\t\tContourDescriptors " + string +"ContDescs"+(i+1)+" = ContourDescriptors.create();");
	surfInfoFile.newLine();
	if(ContDatas != null)
	{				
		for(int j = 0; j < ContDatas.getarraysize(); j++)
		{
			surfInfoFile.write("\t\tintseq " + string +"EdgeIds"+(i+1)+" = intseq.create();");
			surfInfoFile.newLine();
			
			ContourDescriptor ContData = ContDatas.get(j);
			intseq EdgeIds = ContData.GetEdgeIds();
				
			PrintEdgeIdArray(EdgeIds, string, i, surfInfoFile);

			surfInfoFile.write("\t\tContourDescriptor "+string +"ContDesc"+ (i+1) +" = wfcGeometry.ContourDescriptor_Create("+otkTypeEnums.ContourTraversalGet(ContData.GetContourTraversal().getValue()) +", "+string +"EdgeIds"+(i+1)+");");
			surfInfoFile.newLine();
			surfInfoFile.write("\t\t"+string +"ContDescs"+(i+1)+".append("+string +"ContDesc"+(i+1)+");\n");
			surfInfoFile.newLine();
		} // for(int j)
	}  else {
		surfInfoFile.write("\t\t"+string +"ContDescs"+(i+1)+" = 0;" );
		surfInfoFile.newLine();
	}
	
	switch(SurfDesc.GetSurfaceType().getValue())
	{
		case SurfaceType._SURFACE_PLANE:
		{
			surfInfoFile.write("\t\t// SURFACE_PLANE" );
			surfInfoFile.newLine();
			SurfaceDescriptor surfDes =  (SurfaceDescriptor)(SurfDesc);
			PlaneDescriptor  Plane = (PlaneDescriptor)(surfDes);
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(Plane);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
									
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);

			surfInfoFile.write("\t\tWPlaneDescriptor  " + string  +"PlaneDesc" + (i+1)  +" = wfcGeometry.WPlaneDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(TransSurfDesc.GetOrientation().getValue())  + ", " +string +"TransformD" +(i+1) + ", " + SurfDesc.GetSurfaceId()+", " + string + "ContDescs"+ (i+1) + "); " );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"PlaneDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		} 
		case SurfaceType._SURFACE_CYLINDER:
		{
			surfInfoFile.write("\t\t// SURFACE_CYLINDER" );
			surfInfoFile.newLine();
			
			CylinderDescriptor  Cylinder = (CylinderDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(Cylinder);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);
			
			surfInfoFile.write("\t\tWCylinderDescriptor  " + string  +"CylinDesc" + (i+1)  +" = wfcGeometry.WCylinderDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(TransSurfDesc.GetOrientation().getValue())  + ", " +string +"TransformD" +(i+1) +", " + Cylinder.GetRadius() +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"CylinDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_CONE:
		{
			surfInfoFile.write("\t\t// SURFACE_CONE" );
			surfInfoFile.newLine();
			
			ConeDescriptor  Cone = (ConeDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(Cone);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);
			
			surfInfoFile.write("\t\tWConeDescriptor  " + string  +"ConeDesc" + (i+1)  +" = wfcGeometry.WConeDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(TransSurfDesc.GetOrientation().getValue())  + ", " +string +"TransformD" +(i+1) +", " + Cone.GetAlpha() +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"ConeDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_TORUS:
		{
			surfInfoFile.write("\t\t// SURFACE_TORUS" );
			surfInfoFile.newLine();
			
			TorusDescriptor  Torus = (TorusDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(Torus);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);
			
			surfInfoFile.write("\t\tWTorusDescriptor  " + string  +"TorusDesc" + (i+1)  +" = wfcGeometry.WTorusDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(TransSurfDesc.GetOrientation().getValue())  + ", " +string +"TransformD" +(i+1) +", " + Torus.GetRadius1() +"," +Torus.GetRadius2() +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"TorusDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_RULED:
		{
			surfInfoFile.write("\t\t// SURFACE_RULED" );
			surfInfoFile.newLine();
			
			RuledSurfaceDescriptor  RuledSurf = (RuledSurfaceDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(RuledSurf);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);
			
			CurveDescriptor  CurveDesc1 = RuledSurf.GetProfile1();
			otkCreateIntfDataUtils.CreateCurveDescriptor (CurveDesc1, i, "SD1", className, surfInfoFile);

			CurveDescriptor  CurveDesc2 = RuledSurf.GetProfile2();
			otkCreateIntfDataUtils.CreateCurveDescriptor (CurveDesc2, i, "SD2", className, surfInfoFile);

			surfInfoFile.write("\t\tWRuledSurfaceDescriptor  " + string  +"RuledSurfDesc" + (i+1)  +" = wfcGeometry.WRuledSurfaceDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(TransSurfDesc.GetOrientation().getValue())  + ", " +string +"TransformD" +(i+1) +", SD1CurvDesc" +(i+1) +", SD2CurvDesc" +(i+1) +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"RuledSurfDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_REVOLVED:
		{
			surfInfoFile.write("\t\t// SURFACE_REVOLVED" );
			surfInfoFile.newLine();
			
			RevolvedSurfaceDescriptor  RevSurf = (RevolvedSurfaceDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(RevSurf);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);
			
			CurveDescriptor  CurveDesc = RevSurf.GetProfile();
			otkCreateIntfDataUtils.CreateCurveDescriptor (CurveDesc, i, "SDR", className, surfInfoFile);

			surfInfoFile.write("\t\tWRevolvedSurfaceDescriptor  " + string  +"RevSurfDesc" + (i+1)  +" = wfcGeometry.WRevolvedSurfaceDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(TransSurfDesc.GetOrientation().getValue())  + ", " +string +"TransformD" +(i+1) +", SDRCurveDesc" +(i+1) +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"RevSurfDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_TABULATED_CYLINDER:
		{
			surfInfoFile.write("\t\t// SURFACE_TABULATED_CYLINDER" );
			surfInfoFile.newLine();
			
			TabulatedCylinderDescriptor  TabCylider = (TabulatedCylinderDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(TabCylider);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);
			
			CurveDescriptor  CurveDesc = TabCylider.GetProfile();
			otkCreateIntfDataUtils.CreateCurveDescriptor (CurveDesc, i, "SD", className, surfInfoFile);

			surfInfoFile.write("\t\tWTabulatedCylinderDescriptor  " + string  +"TabCyliderDesc" + (i+1)  +" = wfcGeometry.WTabulatedCylinderDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(TransSurfDesc.GetOrientation().getValue())  + ", " +string +"TransformD" +(i+1) +", SDCurveDesc" +(i+1) +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"TabCyliderDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}		
		case SurfaceType._SURFACE_SPLINE:
		{
			surfInfoFile.write("\t\t// SURFACE_SPLINE" );
			surfInfoFile.newLine();
			
			SplineSurfaceDescriptor  SplineSurf = (SplineSurfaceDescriptor)((SurfaceDescriptor)(SurfDesc));
			WSplineSurfaceDescriptor  WSplineSurf = (WSplineSurfaceDescriptor)(SplineSurf);
			
			otkCreateIntfDataUtils.CreatePfcSplineSurfaceDescriptor(SplineSurf, i, string, className, surfInfoFile);

			surfInfoFile.write("\t\tWSplineSurfaceDescriptor  " + string  +"WSurfDesc" + (i+1)  +" = (WSplineSurfaceDescriptor)(" + string  +"SplineSurfDesc" + (i+1) + "); \n" );
			surfInfoFile.newLine();
			surfInfoFile.write("\t\t" + string  +"WSurfDesc" + (i+1)  +".SetNumberOfUParams(" +WSplineSurf.GetNumberOfUParams() +");" );
			surfInfoFile.newLine();
			surfInfoFile.write("\t\t" + string  +"WSurfDesc" + (i+1)  +".SetNumberOfVParams(" +WSplineSurf.GetNumberOfVParams() +");" );
			surfInfoFile.newLine();
			surfInfoFile.write("\t\t"+ string +"WSurfDesc"+ (i+1) +".SetContourData("+string + "ContDescs"+(i+1)+");" );
			surfInfoFile.write("\t\t"+ string +"WSurfDesc"+ (i+1) +".SetSurfaceId("+WSplineSurf.GetSurfaceId()+");" );
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"WSurfDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_NURBS:
		{
			surfInfoFile.write("\t\t// SURFACE_NURBS" );
			surfInfoFile.newLine();
			NURBSSurfaceDescriptor  Nurbs = (NURBSSurfaceDescriptor)((SurfaceDescriptor)(SurfDesc));
						
			SurfaceExtents  SurfExtents = SurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);			

			realseq  UKnots = Nurbs.GetUKnots();
			surfInfoFile.write("\t\trealseq  wUKnots" +(i+1)  + " = realseq.create();");
			surfInfoFile.newLine();
			
			for(int j = 0; j < UKnots.getarraysize(); j++)
			{
				surfInfoFile.write("\t\twUKnots" +(i+1) +".append(" + UKnots.get(j) +"); " );
				surfInfoFile.newLine();
			}

			realseq  Vknots = Nurbs.GetVKnots();
			surfInfoFile.write("\t\trealseq  wVKnots" +(i+1)  + " = realseq.create();");
			surfInfoFile.newLine();
			for(int j = 0; j < Vknots.getarraysize(); j++)
			{
				surfInfoFile.write("\t\twVKnots" +(i+1) +".append(" + Vknots.get(j) +"); " );
				surfInfoFile.newLine();
			}

			BSplinePoints  BSplines = Nurbs.GetPoints();
			surfInfoFile.write("\t\tBSplinePoints  wBSplines" +(i+1)  +" = BSplinePoints.create();");
			surfInfoFile.newLine();
			for(int k = 0; k < BSplines.getarraysize(); k++)
			{
				BSplinePoint  BSpline = BSplines.get(k);
				
				Point3D  Point = BSpline.GetPoint();
				surfInfoFile.write("\t\tPoint3D  " +string +"Point" +(i+1) +"_" + (k+1) +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + ");" );
				surfInfoFile.newLine();

				if(BSpline.GetWeight() != null)
				{
					surfInfoFile.write("\t\tCreatePfcBSplinePoints(" +string  + "Point" +(i+1) +"_" + (k+1) +", " + BSpline.GetWeight()  +", wBSplines" +(i+1)  +");" );
					surfInfoFile.newLine();
				}
				else
				{
					surfInfoFile.write("\t\tCreatePfcBSplinePoints(" +string  + "Point" +(i+1) +"_" + (k+1) +", 0.00, wBSplines" +(i+1)  +");" );
					surfInfoFile.newLine();
				}
			}
			surfInfoFile.write("\t\tWNURBSSurfaceDescriptor  " + string  +"NurbsDesc" + (i+1)  +" = wfcGeometry.WNURBSSurfaceDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(SurfDesc.GetOrientation().getValue())  +", " + Nurbs.GetUDegree()  +","  + Nurbs.GetVDegree() +", wUKnots" + (i+1)  +", wVKnots" + (i+1)  +", wBSplines" + (i+1) +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"NurbsDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_CYLINDRICAL_SPLINE:
		{
			surfInfoFile.write("\t\t// SURFACE_CYLINDRICAL_SPLINE" );
			surfInfoFile.newLine();
			
			CylindricalSplineSurfaceDescriptor  CylinSpline = (CylindricalSplineSurfaceDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(CylinSpline);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);

			SplineSurfaceDescriptor  SplineSurf = CylinSpline.GetSplineSurfaceData();
			otkCreateIntfDataUtils.CreatePfcSplineSurfaceDescriptor(SplineSurf, i, string, className, surfInfoFile);
			
			surfInfoFile.write("\t\tWCylindricalSplineSurfaceDescriptor  " + string  +"CylinSplineSurfDesc" + (i+1)  +" = wfcGeometry.WCylindricalSplineSurfaceDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(SurfDesc.GetOrientation().getValue()) +", "  + string +"TransformD" + (i+1) +", " + string  +"SplineSurfDesc" + (i+1) +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"CylinSplineSurfDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();	
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_SPHERICAL_SPLINE:
		{
			surfInfoFile.write("\t\t// SURFACE_SPHERICAL_SPLINE" );
			surfInfoFile.newLine();
			
			SphericalSplineSurfaceDescriptor  SphSpline = (SphericalSplineSurfaceDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(SphSpline);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);

			SplineSurfaceDescriptor  SplineSurf = SphSpline.GetSplineSurfaceData();
			otkCreateIntfDataUtils.CreatePfcSplineSurfaceDescriptor(SplineSurf, i, string, className,surfInfoFile);
			
			surfInfoFile.write("\t\tSphericalSplineSurfaceDescriptor  " + string  +"SphSplineSurfDesc" + (i+1)  +" = pfcGeometry.SphericalSplineSurfaceDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(SurfDesc.GetOrientation().getValue()) +", "  + string +"TransformD" + (i+1) +", " + string  +"SplineSurfDesc" + (i+1) +", " + "); \n" );
			surfInfoFile.newLine();
			
			surfInfoFile.write("\t\tSurfaceDescriptor  p" + string  +"SurfDesc" + (i+1)  +" = (SurfaceDescriptor)(" + string  +"SphSplineSurfDesc" + (i+1) +");" );
			surfInfoFile.newLine();
			
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"SurfDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
		case SurfaceType._SURFACE_FOREIGN:
		{
			surfInfoFile.write("\t\t// SURFACE_FOREIGN" );
			surfInfoFile.newLine();
			
			ForeignSurfaceDescriptor  ForeignSurf = (ForeignSurfaceDescriptor)((SurfaceDescriptor)(SurfDesc));
			TransformedSurfaceDescriptor  TransSurfDesc = (TransformedSurfaceDescriptor)(ForeignSurf);
			
			otkCreateIntfDataUtils.CreateTransformedSurface(TransSurfDesc, i, className, string, surfInfoFile);
													
			SurfaceExtents  SurfExtents = TransSurfDesc.GetExtents();
			otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, surfInfoFile);

			surfInfoFile.write("\t\tWForeignSurfaceDescriptor  " + string  +"ForeignSurfDesc" + (i+1)  +" = wfcGeometry.WForeignSurfaceDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(SurfDesc.GetOrientation().getValue()) +", "  + string +"TransformD" + (i+1) +", " +ForeignSurf.GetForeignID() +", "+ SurfDesc.GetSurfaceId() +", "+string +"ContDescs"+(i+1)+"); \n" );
			surfInfoFile.newLine();
			surfInfoFile.write("\t\tWSurfaceDescriptor  " + string  +"SurfDesc" + (i+1)  +" = (WSurfaceDescriptor)(" + string  +"ForeignSurfDesc" + (i+1)  +");\n");
			surfInfoFile.newLine();
			surfInfoFile.newLine();
			break;
		}
	} // switch()

	
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************* /
// creates a spline surface descriptor data
public static void CreatePfcSplineSurfaceDescriptor(SplineSurfaceDescriptor  SplineSurf, int i, String string, String className, BufferedWriter splSurfInfoFile)
{
	try
	{

	SurfaceExtents  SurfExtents = SplineSurf.GetExtents();
	otkCreateIntfDataUtils.CreateSurfaceExtents(SurfExtents, i, className, string, splSurfInfoFile);
			
	SplineSurfacePoints  Points = SplineSurf.GetPoints();
	splSurfInfoFile.write("\t\tSplineSurfacePoints  " +string +"Points" + (i+1)  +" = SplineSurfacePoints.create();" );
	splSurfInfoFile.newLine();
	for(int j = 0; j < Points.getarraysize(); j++)
	 {
		 SplineSurfacePoint  Point = Points.get(j);
		 UVParams  UVParam = Point.GetParameter();

		 splSurfInfoFile.write("\t\tUVParams  " + string  +"UVParam" + (i+1)  +"_" +  (j+1)  +" = " + className +".CreatePfcUVParams("  + UVParam.get(0)  + ", "  + UVParam.get(1)  + ");" );
		 splSurfInfoFile.newLine();
		 
		 Point3D 	PointD = Point.GetPoint();
		 splSurfInfoFile.write("\t\tPoint3D  " +string +"PointD" +(i+1) +"_" + (j+1) +" = " + className +".CreatePfcPoint3D( " +PointD.get(0) + " , "  +PointD.get(1) + " , "  +PointD.get(2) + ");");
		 splSurfInfoFile.newLine();
		 
		 Vector3D  UTangent = Point.GetUTangent();
		 if(UTangent != null)
		 {
			splSurfInfoFile.write("\t\tVector3D  " +string  + "UTangent" + (i+1)  +"_" + (j+1) +" = " + className +".CreatePfcVector3D ( " + UTangent.get(0)  + " , " + UTangent.get(1)  + " , " + UTangent.get(2)  + " );");
			splSurfInfoFile.newLine();
		}
		 else
		 {
			splSurfInfoFile.write("\t\tVector3D  " +string  + "UTangent" + (i+1)  +"_" + (j+1) +" = 0;" );
			splSurfInfoFile.newLine();
		}

		 Vector3D  VTangent = Point.GetVTangent();
		 if(VTangent != null)
		 {
			splSurfInfoFile.write("\t\tVector3D  " +string  + "VTangent" + (i+1)  +"_" + (j+1) +" = " + className +".CreatePfcVector3D ( " + VTangent.get(0)  + " , " + VTangent.get(1)  + " , " + VTangent.get(2)  + " );");
			splSurfInfoFile.newLine();
		}
		 else
		 {
			splSurfInfoFile.write("\t\tVector3D  " +string  + "VTangent" + (i+1)  +"_" + (j+1) +" = 0;" );
			splSurfInfoFile.newLine();
		}

		 Vector3D  UVDeriv = Point.GetUVDerivative();
		 if(UVDeriv != null)
		 {
			splSurfInfoFile.write("\t\tVector3D  " +string  + "UVDeriv" + (i+1)  +"_" + (j+1) +" = " + className +".CreatePfcVector3D ( " + UVDeriv.get(0)  + " , " + UVDeriv.get(1)  + " , " + UVDeriv.get(2)  + " );");
			splSurfInfoFile.newLine();
		}
		 else
		 {
			splSurfInfoFile.write("\t\tVector3D  " +string  + "UVDeriv" + (i+1)  +"_" + (j+1) +" = 0;" );
			splSurfInfoFile.newLine();
		}

		splSurfInfoFile.write(className + "\t\t.CreatePfcSplineSurfacePoint(" + string  +"UVParam" + (i+1)  +"_" +  (j+1)  +", " +string +"PointD" +(i+1) +"_" + (j+1) +", " +string  + "UTangent" + (i+1)  +"_" + (j+1) +", " +string  + "VTangent" + (i+1)  +"_" + (j+1) +", " +string  + "UVDeriv" + (i+1)  +"_" + (j+1) +", " +string +"Points" + (i+1)  +");\n");
		splSurfInfoFile.newLine();
		splSurfInfoFile.newLine();
	 }

	splSurfInfoFile.write("\t\tSplineSurfaceDescriptor  " + string  +"SplineSurfDesc" + (i+1)  +" = pfcGeometry.SplineSurfaceDescriptor_Create(" +string +"SurfaceExtents" +(i+1) +", " + otkTypeEnums.SurfaceOrientationGet(SplineSurf.GetOrientation().getValue()) +", "  + string +"Points" + (i+1) +"); \n" );
	splSurfInfoFile.newLine();
	splSurfInfoFile.newLine();
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************* /
// creates a spline points
public static void CreateSplinePoints (SplinePoints  SplPoints, int i, String string, String className, BufferedWriter splineInfoFile)
{
	try
	{
	splineInfoFile.write("\t\tSplinePoints  " +string +"SplPoints" +(i+1) +" = SplinePoints.create();" );
	splineInfoFile.newLine();
	
	for(int j = 0; j < SplPoints.getarraysize(); j++)
	{
		SplinePoint  Spline = SplPoints.get(j);

		Point3D  Point = Spline.GetPoint();
		splineInfoFile.write("\t\tPoint3D  " + string  +"Point"  + (i+1)  +"_" + (j+1)  +" = " +className +".CreatePfcPoint3D( " + Point.get(0)  + " , "  + Point.get(1)  + " , "  + Point.get(2)  + ");" );
		splineInfoFile.newLine();
		
		Vector3D  Vector = Spline.GetTangent();
		splineInfoFile.write("\t\tVector3D  " + string  +"Vector"  + (i+1)  +"_" +  (j+1)  +" = " + className  +".CreatePfcVector3D( " + Vector.get(0)  + " , "  + Vector.get(1)  + " , "  + Vector.get(2)  + ");" );
		splineInfoFile.newLine();

		splineInfoFile.write("\t\t" + className + ".CreatePfcSplinePoints((double)" +Spline.GetParameter() +", " +string  +"Point"  + (i+1)  +"_" + (j+1)  +", " + string  +"Vector"  + (i+1)  +"_" + (j+1)  + ", " + string +"SplPoints" +(i+1) +");" );
		splineInfoFile.newLine();
	}
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************* /
// creates a transformed surface data
public static void CreateTransformedSurface(TransformedSurfaceDescriptor  TransSurfDesc, int i, String className, String string, BufferedWriter transInfoFile)
{
	try
	{
	Transform3D  Trans3D = TransSurfDesc.GetCoordSys ();
	Vector3D  VecX = Trans3D.GetXAxis ();
	Vector3D  VecY = Trans3D.GetYAxis ();
	Vector3D  VecZ = Trans3D.GetZAxis ();
	Point3D   Origin = Trans3D.GetOrigin ();
	Matrix3D  Matrix = Trans3D.GetMatrix();

	// Transform3D 
	transInfoFile.write("\t\tVector3D  " +string +"XAxis" +(i+1) +" = " + className  +".CreatePfcVector3D ( " + VecX.get(0)  + " , " + VecX.get(1)  + " , " + VecX.get(2)  + " );");
	transInfoFile.newLine();
	transInfoFile.write("\t\tVector3D  " +string +"YAxis" +(i+1) +" = " + className  +".CreatePfcVector3D ( " + VecY.get(0)  + " , " + VecY.get(1)  + " , " + VecY.get(2)  + " );");
	transInfoFile.newLine();
	transInfoFile.write("\t\tVector3D  " +string +"ZAxis" +(i+1) +" = " + className  +".CreatePfcVector3D ( " + VecZ.get(0)  + " , " + VecZ.get(1)  + " , " + VecZ.get(2)  + " );");
	transInfoFile.newLine();
	transInfoFile.write("\t\tPoint3D  " +string +"origin" +(i+1) +" = " + className  +".CreatePfcPoint3D( " + Origin.get(0)  + " , "  + Origin.get(1)  + " , "  + Origin.get(2)  + " );" );
	transInfoFile.newLine();
		
	transInfoFile.write("\t\tMatrix3D  " +string +"MatrixD" +(i+1) +" = " + className  +".CreatePfcMatrix3D(" +
						Matrix.get(0,0)  +"," +Matrix.get(0,1)  +"," +Matrix.get(0,2)  +"," +Matrix.get(0,3)  +"," +
						Matrix.get(1,0)  +"," +Matrix.get(1,1)  +"," +Matrix.get(1,2)  +"," +Matrix.get(1,3)  +"," +
						Matrix.get(2,0)  +"," +Matrix.get(2,1)  +"," +Matrix.get(2,2)  +"," +Matrix.get(2,3)  +"," +
						Matrix.get(3,0)  +"," +Matrix.get(3,1)  +"," +Matrix.get(3,2)  +"," +Matrix.get(3,3)  +"); ");
	transInfoFile.newLine();
	
	transInfoFile.write("\t\tTransform3D   " +string +"TransformD" +(i+1) +" = pfcBase.Transform3D_Create(" +string +"MatrixD" + (i+1)  +");\n" );
	transInfoFile.newLine();
	transInfoFile.newLine();
	transInfoFile.write("\t\totkCreateIntfDataUtils.CreatePfcTransform3D(" +string +"XAxis" +(i+1) +", " +string +"YAxis" +(i+1) +"," +string +"ZAxis" +(i+1) +", " +string +"origin" +(i+1) +", " +string +"TransformD" +(i+1) +");\n");
	transInfoFile.newLine();
	transInfoFile.newLine();
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************* /
// creates a surface extents data
public static void CreateSurfaceExtents(SurfaceExtents  SurfExtents, int i, String className, String string,  BufferedWriter surfExtInfoFile)
{
	try
	{
	UVOutline  outline = SurfExtents.GetUVExtents();
	UVParams  param1 = outline.get(0);
	UVParams  param2 = outline.get(1);

	surfExtInfoFile.write("\t\tUVParams  " +string +"UVParam1" +(i+1) +" = " + className +".CreatePfcUVParams("  + param1.get(0)  + ", "  + param1.get(1)  + ");" );
	surfExtInfoFile.newLine();
	surfExtInfoFile.write("\t\tUVParams  " +string +"UVParam2" +(i+1) +" = " + className +".CreatePfcUVParams("  + param2.get(0)  + ", "  + param2.get(1)  + ");" );
	surfExtInfoFile.newLine();
	surfExtInfoFile.write("\t\tUVOutline  " +string +"UVOutline" +(i+1) +" = " + className +".CreatePfcUVOutline(" +string +"UVParam1" +(i+1) +", " +string +"UVParam2" +(i+1) +");" );
	surfExtInfoFile.newLine();
	surfExtInfoFile.write("\t\tSurfaceExtents  " +string +"SurfaceExtents" +(i+1) +" = pfcGeometry.SurfaceExtents_Create (" +string +"UVOutline" +(i+1) +");" );
	surfExtInfoFile.newLine();
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ************************************************************************************************* /
public static Matrix3D  CreatePfcMatrix3D(double a1, double a2, double a3, double a4,
									  double b1, double b2, double b3, double b4,
									  double c1, double c2, double c3, double c4,
									  double d1, double d2, double d3, double d4)
{
	try
	{
		Matrix3D  Ret = Matrix3D.create();
		Ret.set(0,0,a1);
		Ret.set(0,1,a2);
		Ret.set(0,2,a3);
		Ret.set(0,3,a4);
		Ret.set(1,0,b1);
		Ret.set(1,1,b2);
		Ret.set(1,2,b3);
		Ret.set(1,3,b4);
		Ret.set(2,0,c1);
		Ret.set(2,1,c2);
		Ret.set(2,2,c3);
		Ret.set(2,3,c4);
		Ret.set(3,0,d1);
		Ret.set(3,1,d2);
		Ret.set(3,2,d3);
		Ret.set(3,3,d4);

		return(Ret);
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return null;
	
}

// ************************************************************************************************* /
public static UVOutline  CreatePfcUVOutline(UVParams  param1, UVParams  param2)
{
	try
	{
	UVOutline  Ret = UVOutline.create();
	Ret.set(0, param1);
	Ret.set(1, param2);
	
	return(Ret);
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return null;
	
}

// ************************************************************************************************* /
public static UVParams  CreatePfcUVParams(double param1, double param2)
{
	try
	{
	UVParams  Ret = UVParams.create();

	Ret.set(0, param1);
	Ret.set(1, param2);

	return(Ret);
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return null;
}

// ************************************************************************************************** /
 public static Point3D  CreatePfcPoint3D (double X, double Y, double Z)
 {
	try
	{
 	Point3D 		Ret =  Point3D.create();
 
 	Ret . set (0, X);
 	Ret . set (1, Y);
 	Ret . set (2, Z);

 	return (Ret);
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return null;
 }

 // ************************************************************************************************** /
public static Vector3D  CreatePfcVector3D (double X, double Y, double Z)
 {
	try
	{
 	Vector3D 		Ret =  Vector3D.create();
 
 	Ret . set (0, X);
 	Ret . set (1, Y);
 	Ret . set (2, Z);

 	return (Ret);
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return null;
 }

// ************************************************************************************************* /
public static void CreatePfcBSplinePoints(Point3D Point, double weight, BSplinePoints BPoints)
{
	try
	{
	Double value = new Double(weight);
	BSplinePoint BPoint = pfcGeometry.BSplinePoint_Create(Point, value);

	BPoints.append(BPoint);
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}
public static void CreatePfcSplinePoints(double param, Point3D Point, Vector3D Tangent, SplinePoints Points)
{
	try
	{
	SplinePoint splPoint = pfcGeometry.SplinePoint_Create(param, Point, Tangent);

	Points.append(splPoint);
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}
public static void CreatePfcSplineSurfacePoint(UVParams UVParam, Point3D PointD, Vector3D UTangent, Vector3D VTangent, Vector3D UVDeriv, SplineSurfacePoints splPoint)
{
	try
	{
	
	SplineSurfacePoint Point = pfcGeometry.SplineSurfacePoint_Create(UVParam, PointD, UTangent, VTangent, UVDeriv);

	splPoint.append(Point);
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}
public static void CreatePfcTransform3D(Vector3D XAxis, Vector3D YAxis, Vector3D ZAxis, Point3D Origin, Transform3D Trasform3D)
{
	try
	{
	Trasform3D.SetXAxis(XAxis);
	Trasform3D.SetYAxis(YAxis);
	Trasform3D.SetZAxis(ZAxis);
	Trasform3D.SetOrigin(Origin);
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}
public static void CreatePfcUVParamsSeq(double param1, double param2, UVParamsSequence UVParamSeq)
{
	try
	{
	UVParams Ret = UVParams.create();

	Ret.set(0, param1);
	Ret.set(1, param2);

	UVParamSeq.append(Ret);
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}
// ******************************************************************************************** /
public static void PrintEdgeIdArray(intseq EdgeIds, String string, int i, BufferedWriter sinfoFile)
{
	try
	{
	String line;
	int EdgeSize = EdgeIds.getarraysize();
	sinfoFile.newLine();
	sinfoFile.write("\t\tnums = new int [" + EdgeSize + "];");
	sinfoFile.newLine();
	for(int j = 0; j < EdgeSize; j++)
	{
		/*int num1 = EdgeIds.get(j);
		line += ", " + num1;*/
		sinfoFile.write("\t\tnums[" + j + "] = " + EdgeIds.get(j) + ";");
		sinfoFile.newLine();
	}
	line = "\t\totkCreateIntfDataUtils.CreateEdgeIdArray(";
	line += string;
	line += "EdgeIds";
    
	int num = i+1;
    line += num;


	line += ", " + EdgeSize + ", nums";
	

	/*for(int j = 0; j < EdgeSize; j++)
	{
		int num1 = EdgeIds.get(j);
		line += ", " + num1;
		
	}*/
	line += ");";
	sinfoFile.write(line);
	sinfoFile.newLine();
	return;
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ******************************************************************************************** /
public static void CreateEdgeIdArray(intseq EdgeId, int size, int numbers[])
{
	try
	{
	int max = 0;

	for(int k = 0; k < size; k++)
	{
		max = numbers[k];
		EdgeId.append(max);
	}
	}
	catch (Exception e)
	{
		System.out.println("1: " + e);
	}
	return;
}

// ******************************************************************************************** /
public static void CreatePfcUVParamsSeqArr(int count, double param1, double param2, UVParamsSequence UVParamSeq)
{
	for(int a = 0; a < count; a++)
	{
		CreatePfcUVParamsSeq(param1, param2, UVParamSeq);
	}
}
// ************************************************************************************************* /
    
};






